.class public Lcom/waiqin365/lightapp/product/b/a/q;
.super Lcom/waiqin365/lightapp/product/b/d;


# instance fields
.field public b:Ljava/lang/String;

.field public c:Ljava/lang/String;

.field public d:Ljava/util/HashMap;

.field public e:Ljava/util/List;


# direct methods
.method public constructor <init>()V
    .locals 1

    const/16 v0, 0x6e

    invoke-direct {p0, v0}, Lcom/waiqin365/lightapp/product/b/d;-><init>(I)V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/lightapp/product/b/a/q;->e:Ljava/util/List;

    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;)Z
    .locals 12

    const/4 v0, 0x1

    const/4 v1, 0x0

    const/4 v3, 0x0

    :try_start_0
    new-instance v5, Lorg/json/JSONObject;

    invoke-direct {v5, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v2, "code"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_1

    const-string/jumbo v2, "code"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/waiqin365/lightapp/product/b/a/q;->b:Ljava/lang/String;

    const-string/jumbo v2, "1"

    iget-object v4, p0, Lcom/waiqin365/lightapp/product/b/a/q;->b:Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_3

    const-string/jumbo v2, "data"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_7

    const-string/jumbo v2, "data"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    invoke-virtual {v6}, Lorg/json/JSONArray;->length()I

    move-result v7

    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2, v7}, Ljava/util/HashMap;-><init>(I)V

    iput-object v2, p0, Lcom/waiqin365/lightapp/product/b/a/q;->d:Ljava/util/HashMap;

    move v2, v1

    :goto_0
    if-ge v2, v7, :cond_7

    invoke-virtual {v6, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    const-string/jumbo v4, "prod_id"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_0

    new-instance v9, Ljava/util/HashMap;

    invoke-direct {v9}, Ljava/util/HashMap;-><init>()V

    const-string/jumbo v10, "price"

    const-string/jumbo v4, "price"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_4

    move-object v4, v3

    :goto_1
    invoke-virtual {v9, v10, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v10, "unit_id"

    const-string/jumbo v4, "last_unit_id"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_5

    move-object v4, v3

    :goto_2
    invoke-virtual {v9, v10, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v10, "unit_name"

    const-string/jumbo v4, "last_unit_name"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_6

    move-object v4, v3

    :goto_3
    invoke-virtual {v9, v10, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v4, p0, Lcom/waiqin365/lightapp/product/b/a/q;->d:Ljava/util/HashMap;

    const-string/jumbo v10, "prod_id"

    invoke-virtual {v8, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v4, v8, v9}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_1
    move v0, v1

    :cond_2
    :goto_4
    return v0

    :cond_3
    const-string/jumbo v2, "message"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_2

    const-string/jumbo v2, "message"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/waiqin365/lightapp/product/b/a/q;->c:Ljava/lang/String;

    goto :goto_4

    :catch_0
    move-exception v0

    move v0, v1

    goto :goto_4

    :cond_4
    const-string/jumbo v4, "price"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    goto :goto_1

    :cond_5
    const-string/jumbo v4, "last_unit_id"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    goto :goto_2

    :cond_6
    const-string/jumbo v4, "last_unit_name"

    invoke-virtual {v8, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    goto :goto_3

    :cond_7
    const-string/jumbo v2, "promotions"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_2

    iget-object v2, p0, Lcom/waiqin365/lightapp/product/b/a/q;->e:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->clear()V

    const-string/jumbo v2, "promotions"

    invoke-virtual {v5, v2}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    move v5, v1

    :goto_5
    invoke-virtual {v6}, Lorg/json/JSONArray;->length()I

    move-result v2

    if-ge v5, v2, :cond_2

    new-instance v7, Lcom/waiqin365/lightapp/product/d/b;

    invoke-direct {v7}, Lcom/waiqin365/lightapp/product/d/b;-><init>()V

    invoke-virtual {v6, v5}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v4

    const-string/jumbo v2, "promotion_id"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_8

    const-string/jumbo v2, ""

    :goto_6
    invoke-virtual {v7, v2}, Lcom/waiqin365/lightapp/product/d/b;->a(Ljava/lang/String;)V

    const-string/jumbo v2, "title"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_9

    const-string/jumbo v2, ""

    :goto_7
    invoke-virtual {v7, v2}, Lcom/waiqin365/lightapp/product/d/b;->b(Ljava/lang/String;)V

    const-string/jumbo v2, "start_time"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_a

    const-string/jumbo v2, ""

    :goto_8
    invoke-virtual {v7, v2}, Lcom/waiqin365/lightapp/product/d/b;->c(Ljava/lang/String;)V

    const-string/jumbo v2, "end_time"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_b

    const-string/jumbo v2, ""

    :goto_9
    invoke-virtual {v7, v2}, Lcom/waiqin365/lightapp/product/d/b;->d(Ljava/lang/String;)V

    const-string/jumbo v2, "promotion_price"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_c

    move-object v2, v3

    :goto_a
    invoke-virtual {v7, v2}, Lcom/waiqin365/lightapp/product/d/b;->a(Ljava/lang/Double;)V

    const-string/jumbo v2, "prods"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_17

    iget-object v2, v7, Lcom/waiqin365/lightapp/product/d/b;->a:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->clear()V

    const-string/jumbo v2, "prods"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v8

    move v4, v1

    :goto_b
    invoke-virtual {v8}, Lorg/json/JSONArray;->length()I

    move-result v2

    if-ge v4, v2, :cond_17

    new-instance v9, Lcom/waiqin365/lightapp/product/d/a;

    invoke-direct {v9}, Lcom/waiqin365/lightapp/product/d/a;-><init>()V

    invoke-virtual {v8, v4}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v10

    const-string/jumbo v2, "pd_id"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_d

    const-string/jumbo v2, ""

    :goto_c
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->a(Ljava/lang/String;)V

    invoke-virtual {v7}, Lcom/waiqin365/lightapp/product/d/b;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->b(Ljava/lang/String;)V

    const-string/jumbo v2, "price"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_e

    move-object v2, v3

    :goto_d
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->a(Ljava/lang/Double;)V

    const-string/jumbo v2, "is_gift"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_f

    const-string/jumbo v2, "1"

    const-string/jumbo v11, "is_gift"

    invoke-virtual {v10, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v2, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_f

    sget-object v2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    :goto_e
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->a(Ljava/lang/Boolean;)V

    const-string/jumbo v2, "num"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_10

    move-object v2, v3

    :goto_f
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->b(Ljava/lang/Double;)V

    const-string/jumbo v2, "input_unit"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_11

    const-string/jumbo v2, ""

    :goto_10
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->c(Ljava/lang/String;)V

    const-string/jumbo v2, "input_unit_name"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_12

    const-string/jumbo v2, ""

    :goto_11
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->d(Ljava/lang/String;)V

    const-string/jumbo v2, "base_price"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_13

    move-object v2, v3

    :goto_12
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->c(Ljava/lang/Double;)V

    const-string/jumbo v2, "base_unit_name"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_14

    move-object v2, v3

    :goto_13
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->d(Ljava/lang/Double;)V

    const-string/jumbo v2, "base_unit"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_15

    const-string/jumbo v2, ""

    :goto_14
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->e(Ljava/lang/String;)V

    const-string/jumbo v2, "base_unit_name"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_16

    const-string/jumbo v2, ""

    :goto_15
    invoke-virtual {v9, v2}, Lcom/waiqin365/lightapp/product/d/a;->f(Ljava/lang/String;)V

    iget-object v2, v7, Lcom/waiqin365/lightapp/product/d/b;->a:Ljava/util/List;

    invoke-interface {v2, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v2, v4, 0x1

    move v4, v2

    goto/16 :goto_b

    :cond_8
    const-string/jumbo v2, "promotion_id"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_6

    :cond_9
    const-string/jumbo v2, "title"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_7

    :cond_a
    const-string/jumbo v2, "start_time"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_8

    :cond_b
    const-string/jumbo v2, "end_time"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_9

    :cond_c
    const-string/jumbo v2, "promotion_price"

    invoke-virtual {v4, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/fiberhome/gaea/client/d/k;->e(Ljava/lang/String;)Ljava/lang/Double;

    move-result-object v2

    goto/16 :goto_a

    :cond_d
    const-string/jumbo v2, "pd_id"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_c

    :cond_e
    const-string/jumbo v2, "price"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/fiberhome/gaea/client/d/k;->e(Ljava/lang/String;)Ljava/lang/Double;

    move-result-object v2

    goto/16 :goto_d

    :cond_f
    sget-object v2, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;

    goto/16 :goto_e

    :cond_10
    const-string/jumbo v2, "num"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/fiberhome/gaea/client/d/k;->e(Ljava/lang/String;)Ljava/lang/Double;

    move-result-object v2

    goto/16 :goto_f

    :cond_11
    const-string/jumbo v2, "input_unit"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_10

    :cond_12
    const-string/jumbo v2, "input_unit_name"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_11

    :cond_13
    const-string/jumbo v2, "base_price"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/fiberhome/gaea/client/d/k;->e(Ljava/lang/String;)Ljava/lang/Double;

    move-result-object v2

    goto/16 :goto_12

    :cond_14
    const-string/jumbo v2, "base_unit_num"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/fiberhome/gaea/client/d/k;->e(Ljava/lang/String;)Ljava/lang/Double;

    move-result-object v2

    goto/16 :goto_13

    :cond_15
    const-string/jumbo v2, "base_unit"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_14

    :cond_16
    const-string/jumbo v2, "base_unit_name"

    invoke-virtual {v10, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_15

    :cond_17
    iget-object v2, p0, Lcom/waiqin365/lightapp/product/b/a/q;->e:Ljava/util/List;

    invoke-interface {v2, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    add-int/lit8 v2, v5, 0x1

    move v5, v2

    goto/16 :goto_5
.end method
